package com.ruoyi.quartz.service.impl;

import cn.hutool.http.HttpRequest;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.ruoyi.common.core.redis.RedisCache;
import com.ruoyi.common.exception.GlobalException;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.http.HttpUtils;
import com.ruoyi.system.V2.goodInfo.mapper.GoodsInfoMapper;
import com.ruoyi.system.V2.inter.mapper.*;
import com.ruoyi.system.excelImport.pangxie.service.PangXieImportService;
import com.ruoyi.system.gen.IGenAPI;
import com.ruoyi.system.model.domain.*;
import com.ruoyi.system.model.dto.GoodReq;
import com.ruoyi.system.model.mapper.*;
import com.ruoyi.system.model.service.IAccountLableService;
import com.ruoyi.system.outto.core.OutUrlConstant;
import com.ruoyi.system.outto.service.IOutApi;
import com.ruoyi.system.utils.MiMaUtil;
import lombok.extern.slf4j.Slf4j;
import okhttp3.*;
import org.apache.commons.collections4.MapUtils;
import org.apache.http.protocol.HTTP;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import org.springframework.web.bind.annotation.GetMapping;
import sun.security.krb5.internal.PAData;

import javax.annotation.Resource;
import java.io.IOException;
import java.util.*;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;

//import com.taobao.api.request.AlibabaJymItemExternalGoodsBatchOnsaleRequest;
//import com.taobao.api.request.AlibabaJymItemExternalGoodsBatchtaskQueryRequest;
//import com.taobao.api.request.AlibabaJymItemExternalGoodsStatusBatchQueryRequest;
//import com.taobao.api.response.AlibabaJymItemExternalGoodsBatchOnsaleResponse;
//import com.taobao.api.response.AlibabaJymItemExternalGoodsBatchtaskQueryResponse;
//import com.taobao.api.response.AlibabaJymItemExternalGoodsStatusBatchQueryResponse;

/**
 * 定时任务调度测试
 *
 * @author ruoyi
 */
@Slf4j
@Service
public class TaskService {

    @Autowired
    private IGenAPI iGenAPI;
    @Resource
    private ClassSkinMapper classSkinMapper;
    @Resource
    private SkinMapper skinMapper;
    @Autowired
    private IAccountLableService iAccountLableService;
    @Resource
    private AccountInfoMapper accountInfoMapper;

    @Resource
    private SalePartnerMapper salePartnerMapper;
    @Autowired
    private IOutApi iOutApi;

    @Resource
    private GoodsInfoMapper goodsInfoMapper;

    @Autowired
    private RedisCache redisCache;
    @Autowired
    private PangXieImportService pangXieImportService;
    /**
     * 状态码
     */
    public static final String CODE_TAG = "code";

    /**
     * 返回内容
     */
    public static final String MSG_TAG = "msg";


    @Resource
    private SelectPushMapper selectPushMapper;




    @GetMapping("/delAll")
    public void delAll() {

        //获取供货商账号
        GoodsInfo goodsInfo = new GoodsInfo();
        goodsInfo.setSaleState(1);
        List<Long> ids = goodsInfoMapper.accIds(goodsInfo);
        for (Long id : ids) {
            iOutApi.del(id, null, 0, null);
        }
    }

    /**
     * 定时同步标签
     */
    public void synchronousLable() {
        /**
         * 1、查询未售的、未删除
         * 2、循环，获取标签
         * 3、转成字符串，存入account
         */

        AccountInfo accountInfo = new AccountInfo();
        accountInfo.setSaleState(1);
        accountInfo.setDel(0);
        List<AccountInfo> accountInfoList = accountInfoMapper.selectAccountInfoList(accountInfo);
        for (AccountInfo info : accountInfoList) {
            if (StringUtils.isEmpty(info.getAcclable())) {
                AccountLable accountLable = new AccountLable();
                accountLable.setInfoId(info.getId());
                List<AccountLable> accountLables = iAccountLableService.selectAccountLableList(accountLable);
                List<String> collect = accountLables.stream().map(label -> label.getLable()).collect(Collectors.toList());
                if (!CollectionUtils.isEmpty(collect)) {
                    String result = collect.stream().map(String::valueOf).collect(Collectors.joining(","));
                    info.setAcclable(result);
                    accountInfoMapper.updateAccountInfo(info);
                }
            }
        }
    }


    public void ryNoParams() {

        //皮肤列表
        List<Map<String, Object>> skinList = iGenAPI.allSkin();
        for (Map<String, Object> stringObjectMap : skinList) {
            Long id = MapUtils.getLong(stringObjectMap, "id");

            String children = MapUtils.getString(stringObjectMap, "children");
            List<Skin> skins = JSONArray.parseArray(children, Skin.class);
            for (Skin skin : skins) {
                skin.setSkinId(skin.getId());
                skin.setParentId(id);
                skinMapper.insertSkin(skin);
            }

        }
        Long userId = 1l;
        log.info("开始请求皮肤类型");
        List<Map<String, Object>> list = iGenAPI.allSkinType();
        List<ClassSkin> classSkins = JSONArray.parseArray(JSONObject.toJSONString(list), ClassSkin.class);
        classSkins.stream().forEach(c -> c.setCreateId(userId));
        classSkins.stream().forEach(c -> c.setCreateTime(new Date()));
        for (ClassSkin classSkin : classSkins) {

            classSkin.setSkinId(classSkin.getId());
            ClassSkin classSelcet = new ClassSkin();
            classSelcet.setSkinId(classSkin.getId());

            List<ClassSkin> classSkins1 = classSkinMapper.selectClassSkinList(classSelcet);
            if (CollectionUtils.isEmpty(classSkins1)) {
                classSkin.setParentId(1l);
                classSkinMapper.insertClassSkin(classSkin);
            }
            List<Map<String, Object>> listTwo = iGenAPI.allSkinTypeTwo(classSkin.getSkinId());
            List<ClassSkin> classSkinsTwo = JSONArray.parseArray(JSONObject.toJSONString(listTwo), ClassSkin.class);
            classSkinsTwo.stream().forEach(c -> c.setCreateId(userId));
            classSkinsTwo.stream().forEach(c -> c.setCreateTime(new Date()));
            for (ClassSkin skin : classSkinsTwo) {
                ClassSkin kk = new ClassSkin();
                kk.setSkinId(skin.getId());
                List<ClassSkin> kkClass = classSkinMapper.selectClassSkinList(kk);
                skin.setParentId(classSkin.getId());
                if (CollectionUtils.isEmpty(kkClass)) {
                    skin.setSkinId(skin.getId());
                    classSkinMapper.insertClassSkin(skin);
                }
            }


            try {
                Thread.sleep(2000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
        System.out.println("执行无参方法");
    }

    /**
     * 选择账号推送
     */
    public void selectPush(Integer pageSize,SelectPush push,int smPrice,int bigPrice) {

        String config = push.getConfig();
        String games = push.getGames();
        String superId = push.getSuperId();

        GoodReq goodReq = new GoodReq();
        goodReq.setSmPrice(smPrice);
        goodReq.setBigPrice(bigPrice);
        if (StringUtils.isNotEmpty(games)){
            String[] split = games.split(",");
            goodReq.setGameNames(Arrays.asList(split));
        }

        if (StringUtils.isNotEmpty(superId)){
            String[] split = superId.split(",");
            goodReq.setCreateIds(Arrays.asList(split));
        }
        goodReq.setPageSize(pageSize);
        if (StringUtils.isEmpty(config)){
            return;
        }else {
            String[] split = config.split(",");
            Arrays.asList(split).stream().forEach(s ->{
                SalePartner salePartner = salePartnerMapper.selectSalePartnerById(Long.parseLong(s));
                if (Objects.nonNull(salePartner)){
                    goodReq.setSaleCode(salePartner.getSaleName());
                }
                List<GoodsInfo> goodsInfoList =  goodsInfoMapper.selectPush(goodReq);
                for (GoodsInfo goodsInfo : goodsInfoList) {
                    iOutApi.add(goodsInfo.getId(),Long.parseLong(s));
                }
            });
        }
    }

    /**
     * 选择账号推送
     */
    public void selectPush(Integer pageSize,SelectPush push) {

        String config = push.getConfig();
        String games = push.getGames();
        String superId = push.getSuperId();

        GoodReq goodReq = new GoodReq();
        if(!"0".equals(push.getSmPrice())&&!"0".equals(push.getBigPrice())) {
            goodReq.setSmPrice(Integer.parseInt(push.getSmPrice()));
            goodReq.setBigPrice(Integer.parseInt(push.getBigPrice()));
        }
        if (StringUtils.isNotEmpty(games)){
            String[] split = games.split(",");
            goodReq.setGameNames(Arrays.asList(split));
        }

        if (StringUtils.isNotEmpty(superId)){
            String[] split = superId.split(",");
            goodReq.setCreateIds(Arrays.asList(split));
        }
        goodReq.setPageSize(pageSize);
        if (StringUtils.isEmpty(config)){
            return;
        }else {
            String[] split = config.split(",");
            Arrays.asList(split).stream().forEach(s ->{
                SalePartner salePartner = salePartnerMapper.selectSalePartnerById(Long.parseLong(s));
                if (Objects.nonNull(salePartner)){
                    goodReq.setSaleCode(salePartner.getSaleName());
                }
                List<GoodsInfo> goodsInfoList =  goodsInfoMapper.selectPush(goodReq);
                for (GoodsInfo goodsInfo : goodsInfoList) {
                    String goods = "add"+goodsInfo.getId()+s;
                    //查询缓存是否已推送
                    if(Objects.isNull(redisCache.getCacheObject(goods))) {
                        //添加缓存
                        redisCache.setCacheObject(goods,"fangchongfu",5, TimeUnit.MINUTES);
                        iOutApi.add(goodsInfo.getId(), Long.parseLong(s));
                    }
                }
            });
        }
    }
    /**
     * 选择账号推送
     */
    public void selectPush2(Integer pageSize,SelectPush push) {

        String config = push.getConfig();
        String games = push.getGames();
        String superId = push.getSuperId();

        GoodReq goodReq = new GoodReq();

        if (StringUtils.isNotEmpty(games)){
            String[] split = games.split(",");
            goodReq.setGameNames(Arrays.asList(split));
        }

        if (StringUtils.isNotEmpty(superId)){
            String[] split = superId.split(",");
            goodReq.setCreateIds(Arrays.asList(split));
        }
        goodReq.setPageSize(pageSize);
        if (StringUtils.isEmpty(config)){
            return;
        }else {
            String[] split = config.split(",");
            Arrays.asList(split).stream().forEach(s ->{
                SalePartner salePartner = salePartnerMapper.selectSalePartnerById(Long.parseLong(s));
                if (Objects.nonNull(salePartner)){
                    goodReq.setSaleCode(salePartner.getSaleName());
                }
                List<GoodsInfo> goodsInfoList =  goodsInfoMapper.selectPush2(goodReq);
                for (GoodsInfo goodsInfo : goodsInfoList) {
                    iOutApi.add(goodsInfo.getId(),Long.parseLong(s));
                }
            });
        }
    }
    public void selectPushsjzpx(Integer pageSize,SelectPush push) {

        String config = push.getConfig();
        String games = push.getGames();
        String superId = push.getSuperId();

        GoodReq goodReq = new GoodReq();

        if (StringUtils.isNotEmpty(games)){
            String[] split = games.split(",");
            goodReq.setGameNames(Arrays.asList(split));
        }

        if (StringUtils.isNotEmpty(superId)){
            String[] split = superId.split(",");
            goodReq.setCreateIds(Arrays.asList(split));
        }
        goodReq.setPageSize(pageSize);
        if (StringUtils.isEmpty(config)){
            return;
        }else {
            String[] split = config.split(",");
            Arrays.asList(split).stream().forEach(s ->{
                SalePartner salePartner = salePartnerMapper.selectSalePartnerById(Long.parseLong(s));
                if (Objects.nonNull(salePartner)){
                    goodReq.setSaleCode(salePartner.getSaleName());
                }
                List<GoodsInfo> goodsInfoList =  goodsInfoMapper.selectPushsjzpx(goodReq);
                for (GoodsInfo goodsInfo : goodsInfoList) {
                    iOutApi.add(goodsInfo.getId(),Long.parseLong(s));
                }
            });
        }
    }
    public void selectPushPangXie(Integer pageSize, SelectPush push) {

        String config = push.getConfig();
        String games = push.getGames();
        String superId = push.getSuperId();

        GoodReq goodReq = new GoodReq();

        if (StringUtils.isNotEmpty(games)){
            String[] split = games.split(",");
            goodReq.setGameNames(Arrays.asList(split));
        }

        if (StringUtils.isNotEmpty(superId)){
            String[] split = superId.split(",");
            goodReq.setCreateIds(Arrays.asList(split));
        }
        goodReq.setPageSize(pageSize);
        if (StringUtils.isEmpty(config)){
            return;
        }else {
            String[] split = config.split(",");
            Arrays.asList(split).stream().forEach(s -> {
                SalePartner salePartner = salePartnerMapper.selectSalePartnerById(Long.parseLong(s));
                if (Objects.nonNull(salePartner)) {
                    goodReq.setSaleCode(salePartner.getSaleName());
                }
                Map<String, List<GoodsInfo>> listMap = goodsInfoMapper.selectPush(goodReq).stream().collect(Collectors.groupingBy(ss -> ss.getGameName()));
                for (String key : listMap.keySet()) {
                    List<GoodsInfo> goodsInfos = listMap.get(key);
                    pangXieImportService.impostPX(goodsInfos, key, salePartner);
                }
            });

        }
    }

    public void selectPushPangXie2(Integer pageSize, SelectPush push) {

        String config = push.getConfig();
        String games = push.getGames();
        String superId = push.getSuperId();

        GoodReq goodReq = new GoodReq();

        if (StringUtils.isNotEmpty(games)){
            String[] split = games.split(",");
            goodReq.setGameNames(Arrays.asList(split));
        }

        if (StringUtils.isNotEmpty(superId)){
            String[] split = superId.split(",");
            goodReq.setCreateIds(Arrays.asList(split));
        }
        goodReq.setPageSize(pageSize);
        if (StringUtils.isEmpty(config)){
            return;
        }else {
            String[] split = config.split(",");
            Arrays.asList(split).stream().forEach(s -> {
                SalePartner salePartner = salePartnerMapper.selectSalePartnerById(Long.parseLong(s));
                if (Objects.nonNull(salePartner)) {
                    goodReq.setSaleCode(salePartner.getSaleName());
                }
                Map<String, List<GoodsInfo>> listMap = goodsInfoMapper.selectPush3(goodReq).stream().collect(Collectors.groupingBy(ss -> ss.getGameName()));
                for (String key : listMap.keySet()) {
                    List<GoodsInfo> goodsInfos = listMap.get(key);
                    pangXieImportService.impostPX(goodsInfos, key, salePartner);
                }
            });

        }
    }
    public void selectPushPangXiesjzpx(Integer pageSize, SelectPush push) {

        String config = push.getConfig();
        String games = push.getGames();
        String superId = push.getSuperId();

        GoodReq goodReq = new GoodReq();

        if (StringUtils.isNotEmpty(games)){
            String[] split = games.split(",");
            goodReq.setGameNames(Arrays.asList(split));
        }

        if (StringUtils.isNotEmpty(superId)){
            String[] split = superId.split(",");
            goodReq.setCreateIds(Arrays.asList(split));
        }
        goodReq.setPageSize(pageSize);
        if (StringUtils.isEmpty(config)){
            return;
        }else {
            String[] split = config.split(",");
            Arrays.asList(split).stream().forEach(s -> {
                SalePartner salePartner = salePartnerMapper.selectSalePartnerById(Long.parseLong(s));
                if (Objects.nonNull(salePartner)) {
                    goodReq.setSaleCode(salePartner.getSaleName());
                }
                Map<String, List<GoodsInfo>> listMap = goodsInfoMapper.selectPushsjzhpx(goodReq).stream().collect(Collectors.groupingBy(ss -> ss.getGameName()));
                for (String key : listMap.keySet()) {
                    List<GoodsInfo> goodsInfos = listMap.get(key);
                    pangXieImportService.impostPX(goodsInfos, key, salePartner);
                }
            });

        }
    }

    public static void main(String[] args) {
        String body = HttpRequest.get("http://192.168.3.163:7589/yxg?uname=18093522409&pwd=aa120120").execute().body();
        JSONObject string = JSONObject.parseObject(body);
        System.out.println(string);
    }
    public void pushPANGXIEGetTokenApi2() {
        List<SalePartner> salePartnerList = salePartnerMapper.selectSalePartnerListSaleCode("NEWMONIPANGXIE");
        for(SalePartner salePartner : salePartnerList){
            if(salePartner.getName().equals("螃蟹-小智店")||salePartner.getName().equals("螃蟹-阿浩店")||salePartner.getName().equals("螃蟹-梦飞店")) {
                String body = HttpRequest.get("http://47.98.139.135:7777/sjpxzh?uname="+salePartner.getOther()+"&pwd="+salePartner.getTwoOther()).execute().body();
                String token = JSONObject.parseObject(body).getString("token");
                if (!token.contains("登录失败")) {
                    salePartner.setSaleKey(token);
                    salePartnerMapper.updateSalePartner(salePartner);
                }
            }
        }
    }

    public void pushPANGXIEGetTokenApi() {

        List<SalePartner> salePartnerList = salePartnerMapper.selectSalePartnerListSaleCode("PANGXIE");

        Map<String, List<SalePartner>> collect = salePartnerList.stream().collect(Collectors.groupingBy(s -> s.getOther()));

        for (String phone : collect.keySet()) {

            List<SalePartner> partners = collect.get(phone);
            String body = HttpRequest.get("http://jym.maimaizhanghao.com:7589/pxds?uname=" + partners.get(0).getOther() + "&pwd=" + partners.get(0).getTwoOther())
                    .execute().body();

            String token = JSONObject.parseObject(body).getString("px-authorization-merchant");
            if(!token.contains("登录失败！")) {
                for (SalePartner partner : partners) {
                    partner.setSaleKey(token);
                    salePartnerMapper.updateSalePartner(partner);
                }
            }
        }
    }

    public void pushTAOHAOHAOGetTokenApi() {
        List<SalePartner> salePartnerList = salePartnerMapper.selectSalePartnerListSaleCode("MONITAOHAOHAO");
        for(SalePartner salePartner : salePartnerList){
            try {
                String login = loginThh(salePartner);
                String data1 = JSONObject.parseObject(login).getString("data");
                String token = JSONObject.parseObject(data1).getString("token");
                salePartner.setSaleKey(token);
                salePartnerMapper.updateSalePartner(salePartner);
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
    }

    public void pushMONI7881GetTokenApi() {
        String url = "http://jym.maimaizhanghao.com:7781/7781?uname=";
        List<SalePartner> salePartnerList = salePartnerMapper.selectSalePartnerListSaleCode("MONI788ONE");

        for(SalePartner salePartner : salePartnerList){
            String body = HttpRequest.get(url+salePartner.getSaleKey()+"&pwd="+salePartner.getOther()).execute().body();
            String authorization = JSONObject.parseObject(body).getString("Authorization");

            salePartner.setThreeOther(authorization);
            salePartnerMapper.updateSalePartner(salePartner);
        }
    }

    public void pushYISHOUYOUGetTokenApi() {
        String url = "http://py.maimaizhanghao.com:7799/ysy?uname=";
        List<SalePartner> salePartnerList = salePartnerMapper.selectSalePartnerListSaleCode("YISHOUYOU");

        for(SalePartner salePartner : salePartnerList){
            String body = HttpRequest.get(url+salePartner.getSaleKey()+"&pwd="+salePartner.getOther()).execute().body();

            String token = JSONObject.parseObject(body).getString("token");
            salePartner.setTwoOther(token);
            salePartnerMapper.updateSalePartner(salePartner);
        }
    }

    public void pushYOUXIGEGetTokenApi() {
        String url = "http://jym.maimaizhanghao.com:7590/yxg?uname=";
        List<SalePartner> salePartnerList = salePartnerMapper.selectSalePartnerListSaleCode("MONIYOUXIGE");

        for(SalePartner salePartner : salePartnerList){
            String body = HttpRequest.get(url+salePartner.getSaleKey()+"&pwd="+salePartner.getOther()).execute().body();

            String cookie = JSONObject.parseObject(body).getString("cookie");
            salePartner.setTwoOther(cookie);
            salePartnerMapper.updateSalePartner(salePartner);
        }
    }

    public void pushMONIMIMAGetTokenApi() {

        List<SalePartner> salePartnerList = salePartnerMapper.selectSalePartnerListSaleCode("MONIMIMA");
        for(SalePartner salePartner : salePartnerList){
            String login = MiMaUtil.login(salePartner.getSaleKey(), salePartner.getOther());
            String data1 = JSONObject.parseObject(login).getString("data");
            String authorization = JSONObject.parseObject(data1).getString("authorization");
            salePartner.setTwoOther(authorization);
            salePartnerMapper.updateSalePartner(salePartner);
        }
    }

    public void pushCHUANGYOUGetTokenApi(Long config){
        SalePartner salePartner = salePartnerMapper.selectSalePartnerById(config);
        Map<String, Object> params = new HashMap<>();
        params.put("account", salePartner.getTwoOther());
        params.put("password", salePartner.getThreeOther());
        String result = HttpUtils.doPostFormData("https://w1.cy227.com/docking/User-GetToken", params, null);
        String data = JSONObject.parseObject(result).getString("data");
        String token = JSONObject.parseObject(data).getString("token");
        salePartner.setOther(token);
        salePartnerMapper.updateSalePartner(salePartner);
    }


    public void pushSBOGetTokenApi(Long config,String tokenRedis) {

        SalePartner salePartner = salePartnerMapper.selectSalePartnerById(config);
        String username = salePartner.getSaleKey();
        String password = salePartner.getOther();
        String device_type = "pc";

        String url = OutUrlConstant.SBO + "/api/user/public/login";

        Map<String, Object> params = new HashMap<>();
        params.put("username", username);
        params.put("password", password);
        params.put("device_type", device_type);

        String response = HttpUtils.sendPost(url, JSONObject.toJSONString(params), "application/json");

        JSONObject jsonObject = JSONObject.parseObject(response);
        if ("1".equals(jsonObject.getString("code"))){
            String data = jsonObject.getString("data");
            JSONObject dataJson = JSON.parseObject(data);
            String token = dataJson.getString("token");
            log.info("token={}",token);
            redisCache.setCacheObject(tokenRedis,token);
        }
    }

    public void pushJINGYUGetTokenApi(Long config) {

        SalePartner salePartner = salePartnerMapper.selectSalePartnerById(config);
        String url = "https://www.jyyy.games/auth/api/Account/GetTokenForClient";
        Map<String,String> params = new HashMap<>();
        params.put("clientId",salePartner.getOther().split(",")[0]);
        params.put("secret",salePartner.getOther().split(",")[1]);
        params.put("loginName",salePartner.getTwoOther());
        params.put("password",salePartner.getThreeOther());
        String response = com.ruoyi.system.outto.dto.yx7881.utils.HttpUtil.doGet(url, params);
        JSONObject jsonObject = JSONObject.parseObject(response);
        if ("0".equals(jsonObject.getString("code"))){
            String token = jsonObject.getString("data");
            log.info("token={}",token);
            salePartner.setSaleKey(token);
            salePartnerMapper.updateSalePartner(salePartner);
        }
    }


    public static String loginThh(SalePartner salePartner){
        OkHttpClient client = new OkHttpClient().newBuilder()
                .build();
        MediaType mediaType = MediaType.parse("application/json; charset=utf-8");
        RequestBody body = RequestBody.create(mediaType, "{\"type\":2,\"phone\":\""+salePartner.getOther()+"\",\"password\":\""+salePartner.getTwoOther()+"\"}");
        Request request = new Request.Builder()
                .url("https://api.hhaohao.com/app/login")
                .method("POST", body)
                .addHeader("Authorization", "")
                .addHeader("Os", "1")
                .addHeader("Version", "16")
                .addHeader("Pm", "eyJkZXZpY2VfaWQiOiItSSkVuuFNIPNmFwF_CKPTYKexg0kDeq71rYngvWxUG1ajq4y0mAHtZmxfedvhW_tjVDZ5I7UQRGIOKy59-VQxdNJu77qt9B5n386ZbWx3-EXATzd1vyO6stsQg5G_0uumvmi_CZl2HjlhEJH_ACm4mKLcLh3Xx-55l_q4SXZjvmuhac8rkLadmB7Sc1Mi8rQTztWfHNJXMWAHoE5wVjzjmy9AzDYRN_v_k2QSf7k06H0vJPURuZZV-WxGliB3GYneBFCw9bVx1dfSOle5nJOBo32G8S0cLfUddAxeaCniCxbzThKgY6j3nqnVPGsBcPLltHsSJtelMPNn6Z7SbqBKqId0DO5rO7MpdonU2fnjsFUq-LFyBKNW3BgMnZeiWGjT3g==")
                .addHeader("Content-Type", "application/json; charset=utf-8")
                .addHeader("Host", "api.hhaohao.com")
                .addHeader("User-Agent", "okhttp/4.9.1")
                .build();
        try {
            Response response = client.newCall(request).execute();
            String string = response.body().string();
            return string;
        } catch (IOException e) {
            e.printStackTrace();
        }
        return null;
    }

}
